using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

using SqlWebAdmin.CSharp;

public partial class Error : System.Web.UI.Page
{
    private string ErrorLookup(int i)
    {
        switch (i)
        {
            case Globals.databaseNotFoundErrorNumber:
                return "Database does not exist.";
            case Globals.storedProcedureNotFoundErrorNumber:
                return "Stored procedure does not exist.";
            case Globals.tableNotFoundErrorNumber:
                return "Table does not exist.";
            case Globals.columnNotFoundErrorNumber:
                return "Column does not exist.";
            case Globals.unknownDataType:
                return "Unknown data type.";
            case Globals.invalidDataTypeSetting:
                return "Invalid data type setting.";
            default:
                return "Unknown error.";
        }
    }

    protected void Page_Load(object sender, EventArgs e)
    {
        Exception ex = Server.GetLastError();
        if( ex != null )
        {
            lblError.Text = HttpUtility.HtmlEncode(Common.ConcatenateExceptions(ex));
        }

        lblError.Visible = ex == null ? false : true;
    }
}
